{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a6958421",
   "metadata": {},
   "source": [
    "**2022/10/25 礼仪的week10**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ceeb3af9",
   "metadata": {},
   "source": [
    "# 1.1复习\n",
    "while 循环是当某种条件成立时，停止循环\n",
    "while True 是无限循环/死循环"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "748f5196",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "卡配罗 criska 0\n",
      "卡配罗 criska 2\n",
      "卡配罗 criska 4\n",
      "卡配罗 criska 6\n",
      "卡配罗 criska 8\n"
     ]
    }
   ],
   "source": [
    "count=0  # count等于0,从0开始计数\n",
    "while True:#无限循环以下内容\n",
    "    print(\"卡配罗 criska\",count)\n",
    "    count+=2    # count+ 的意思就是你每个数相差多少\n",
    "    if count==10:\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c9a7e402",
   "metadata": {},
   "outputs": [],
   "source": [
    "#1.2 账户密码登录迭代——while True\n",
    "\n",
    "#定义变量\n",
    "账户01='criska'\n",
    "密码01='0708'\n",
    "#调用input\n",
    "#计数\n",
    "count=0\n",
    "while True:\n",
    "    账号=input(\"账号：\")\n",
    "    密码=input(\"密码：\")\n",
    "    if 账号==账户01 and 密码==密码01:\n",
    "        print('账号密码输入正确，欢迎'+int('账号'))\n",
    "        break\n",
    "    else:\n",
    "        if count<2:\n",
    "            print('您的账号不存在或密码输入错误，您还有'+str(2-count)+'次机会，请重新尝试!')\n",
    "        else:\n",
    "            print('输入次数已达上限，您的账号已被锁定，请一个小时候再试！')\n",
    "            break\n",
    "        count=count+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff2251bf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
